home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 62 / Quick PC 62.iso / I386 / IIS5_01.CAB / IIS_Session_JScript.asp < prev    next >
Encoding:
Text File  |  1998-05-29  |  1.5 KB  |  58 lines

  1. <%@ LANGUAGE = JScript %>
  2.  
  3. <!*************************
  4. This sample is provided for educational purposes only. It is not intended to be 
  5. used in a production environment, has not been tested in a production environment, 
  6. and Microsoft will not provide technical support for it. 
  7. *************************>
  8.  
  9. <%
  10.     //Ensure that this page is not cached.
  11.  
  12.     Response.Expires = 0;
  13. %>
  14.  
  15. <HTML>
  16.     <HEAD>
  17.         <TITLE>Using Session Variables</TITLE>
  18.     </HEAD>
  19.  
  20.     <BODY BGCOLOR="White" TOPMARGIN="10" LEFTMARGIN="10">
  21.  
  22.         <!-- Display header. -->
  23.  
  24.         <FONT SIZE="4" FACE="ARIAL, HELVETICA">
  25.         <B>Using Session Variables</B></FONT><BR>
  26.       
  27.         <HR SIZE="1" COLOR="#000000">
  28.  
  29.         <%
  30.             //If this is the first time a user has visited
  31.             //the page, initialize Session Value.
  32.  
  33.             if (Session("SessionCountJScript") == null) 
  34.             {
  35.                 Session("SessionCountJScript") = 0;
  36.             }
  37.  
  38.  
  39.             //Increment the Session PageCount by one.
  40.             //Note that this PageCount value is only
  41.             //for this user's individual session.
  42.  
  43.             Session("SessionCountJScript") = Session("SessionCountJScript") + 1;
  44.         %>
  45.  
  46.  
  47.         <!-- Output the Session Page Counter Value. -->
  48.  
  49.         You have personally visited this page 
  50.         <%= Session("SessionCountJScript") %> times.
  51.  
  52.  
  53.         <!-- Provide a link to revisit the page. -->
  54.  
  55.         <P><A HREF="Session_JScript.asp">Click here to visit it again</A>
  56.     </BODY>
  57. </HTML>
  58.